import { defineStore } from 'pinia';

export const useLoginStore = defineStore('userlogin', {
  state: () => ({
    active: false,
    loading: false,
    loginButtonDisabled: false,
    remember: false,
    formValue: {
      username: '',
      password: '',
    },
    rules: {
      username: {
        required: true,
        trigger: ['input'],
        message: "请输入正确的电话号码",
        validator: (rule, value) => /^1[3-9]\d{9}$/.test(value),
      },
      password: {
        required: true,
        message: "请输入密码",
        trigger: ['input'],
      },
    },
  }),
});